import React from 'react';

import { setDocumentTitle } from  '../../components/utils';

import Pagination from '../../../../components/pagination/Pagination.jsx';

export default class PaginationPage extends React.Component{
  constructor(props){
    super(props);
    setDocumentTitle('Pagination');
  }
  render(){
    let props = {
      current: 5,
      total: 300,
      firstPage: '首页',
      lastPage: '尾页',
      showTotal: function (total, pages, current) {
        return <div><span style={{paddingRight: '10px'}}>总数: {total}</span>页码: {current} / {pages} </div>;
      },
      onPageChange: function(current, settings){
        console.log(current);
      },
      hasSizeChanger: true,
      pageSizeOptions: [10, 20, 30, 50],
      hasQuickJumper: true
    }
    return <div className={'pagination-page'}>
      <div className={'pagination-example'}>
        <Pagination {...props} />
      </div>
      <div className='pagination-example'>
        <Pagination total={300} />
      </div>
    </div>
  }
}